package online.inote.common.exception;

import online.inote.common.utils.StringUtils;

/**
 * <p>
 * Desc: 业务异常
 * </p>
 *
 * @author Sui
 * @created: 2017年12月2日 下午11:58:03
 * @version 1.0
 */
public class BusException extends RuntimeException {

	private static final long serialVersionUID = -8713907139399866348L;

	public BusException() {
		super();
	}
	
	public BusException(String message, Object... o) {
		super(StringUtils.initMessage(message, o));
	}

	public BusException(Throwable cause) {
		super(cause);
	}
	
	public BusException(String message, Throwable cause, Object... o) {
		super(StringUtils.initMessage(message, o), cause);
	}
	
	public static void throwException(String message) {
		throw new BusException(message);
	}
	
	public static void throwException(Throwable cause) {
		throw new BusException(cause);
	}
	
	public static void throwException(String message, Throwable cause, Object... o) {
		throw new BusException(StringUtils.initMessage(message, o), cause);
	}
}
